package com.example.shuiyin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("payments")
public class Payment {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField("user_id")
    private Long userId;
    
    @TableField("order_id")
    private String orderId;           // 订单ID
    
    @TableField("transaction_id")
    private String transactionId;     // 交易ID
    
    private BigDecimal amount;        // 金额
    
    @TableField("payment_method")
    private String paymentMethod;     // 支付方式(wx, alipay)
    
    private String status;            // 状态(pending, success, failed, canceled)
    private String metadata;          // 元数据(JSON格式)
    
    @TableField("payment_type")
    private String paymentType;       // 支付类型(subscription, oneTime)
    
    @TableField("paid_at")
    private LocalDateTime paidAt;     // 支付时间
    
    @TableField("expired_at")
    private LocalDateTime expiredAt;  // 过期时间
    
    @TableField("created_at")
    private LocalDateTime createdAt;
    
    @TableField("updated_at")
    private LocalDateTime updatedAt;
} 